<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jspf/must/basePath.jspf" %>

<!--后台UI组件Start-->
<%@include file="/WEB-INF/jspf/zj/ligerui/LigerUI.jspf" %>
<%@include file="/WEB-INF/jspf/zj/ztree/ztree.jspf" %>
<%--<%@include file="/WEB-INF/jspf/zj/ligerui/LigerUI_form.jspf" %>--%>
<!--后台UI组件End-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>

        <script src="power/syspower/VIEW_SYSPOWER.js" type="text/javascript"></script>
        <script type="text/javascript">
//-------------------------------全局变量-------------------------------------------------
            $(function() {
                var USERID = "${param.user_id}";
                $("#toptoolbar").ligerToolBar({items: [
                        {text: '确认', click: save}
                    ]});
                var USER_POWER = myajax("weixinkeji/dev/power/center/sysup/manager/s/userPower.imy", {"uID": USERID});
                powerTree("#tree");
                for (var i = 0; i < USER_POWER.length; i++) {
                    setPowerTree("tree", USER_POWER[i].power_id);
                }
                
                function save() {
                    var ids = getPowerTreeCheckID("tree");
                    if (ids.length > 0) {
                        post_json("weixinkeji/dev/power/center/sysup/adu/add.imy", {"uID": USERID, "pID": ids}, 400, 200);
                    } else {
                        post_json("weixinkeji/dev/power/center/sysup/adu/add.imy", {"uID": USERID}, 400, 200);
                    }
                }
            });
//-------------------------------GRID列函数-----------------------------------------------

//-------------------------------增删改操作-----------------------------------------------

        </script>
    </head>
    <body>
        <div id="toptoolbar"></div>
        <div style="margin-left: 200px;width:100%">
            <ul id="tree" class="ztree" style="width:230px; overflow:auto;"></ul>
        </div>
    </body>
</html>
